You are here: Building the Model: Advanced Elements > Subroutines > Subroutine Example
Suppose that you build a Copy Center model and it is necessary to define the processing time at the operator assisted machines as a function of two parameters: Order Quantity and Quality Level. In addition, you would also like to write the processing times at each copy machine to a file called Report.Dat.
Because the operation logic is identical at both machines, a subroutine may be used to execute the group of statements required. Notice in the Process Logic pictured next that Subroutine OrderTime is called, and each order's Quantity, Quality, and Ticket attributes are passed as arguments. The third argument is simply a constant value, 1 or 2, which represents the location from which the subroutine was called (i.e., 1 if called from OpAsist1 or 2 if called from OpAsist2). The operation logic, which calls the subroutine, and routing are shown below. The subroutine itself is shown later in this section.